package ${package.Controller};

import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.List;
import org.springframework.web.bind.annotation.RestController;
<#if superControllerClassPackage??>
    import ${superControllerClassPackage};
</#if>

/**
*
* @author ${author}
* @since ${date}
*/
@RestController
@Tag(name = "${table.comment!}管理")
@RequestMapping(SysApiConstant.SYS_API + "${controllerMappingHyphen?replace("-","_")}")
public class ${entity}Api {
private final ${table.serviceName} ${table.entityPath}Service;

@Autowired
public ${entity}Api(${table.serviceName} ${table.entityPath}Service) {
this.${table.entityPath}Service = ${table.entityPath}Service;
}

@PostMapping("/page")
@ResponseResult
@Operation(summary = "${table.comment!}列表分页查询")
public PageVO<${entity}> page(@Validated @RequestBody PageParam param)throws IllegalAccessException{
return this.${table.entityPath}Service.page(param);
}

@GetMapping("/get/{id}")
@ResponseResult
@Operation(summary = "${table.comment!}详情查询")
public ${entity} get(@PathVariable("id") String id){
return this.${table.entityPath}Service.get(id);
}

@PostMapping("/save")
@ResponseResult
@Operation(summary = "${table.comment!}保存")
public Boolean save(@RequestBody @Validated(SaveGroup.class) ${entity} ${table.entityPath}){
return this.${table.entityPath}Service.add(${table.entityPath});
}


@PostMapping("/modify")
@ResponseResult
@Operation(summary = "${table.comment!}修改")
public Boolean modify(@RequestBody @Validated(UpdateGroup.class) ${entity} ${table.entityPath}) {
return this.${table.entityPath}Service.modify(${table.entityPath});
}


@PostMapping("/del")
@ResponseResult
@Operation(summary = "${table.comment!}删除")
public Boolean delete(@RequestBody List
<String> ids){
    return this.${table.entityPath}Service.del(ids);
    }
    }